package cn.genmer.test.security.designpatterns.singleton;

/**
 * @program: concurrency_practice
 * @description: 懒汉式（线程不安全）- 不可用
 * @author: Genmer
 * @create: 2020-10-21 01:04
 **/
public class Singleton3 {
    // 构造方法和对象都是私有的
    private  static Singleton3 INSTANCE;

    // 这方式构造方法内容
    private Singleton3(){}

    public static Singleton3 getInstance(){
        if (INSTANCE == null){
            INSTANCE = new Singleton3();
        }
        return INSTANCE;
    }
}
